

package examplelesson2;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;



/**
 *
 * @author LamHuynh
 */
public class DOMCreator {

    
    public static void main(String[] args) {
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document doc = db.newDocument();
            Element root = doc.createElement("tomcat-users");
            doc.appendChild(root);
            Element comment = (Element) doc.createComment("tomcat configur");
            root.appendChild(comment);


        } catch (Exception e) {
        }
    }

}
